import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.*;

public class Index extends HttpServlet
{

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {

        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        String dbUser = "jh3240"; // enter your username here
        String dbPassword = "kuzifQbw"; // enter your password here

        out.println("<html>");
        out.println("<head>");
        out.println("<title>");
        out.println("Baseball Database");
        out.println("</title>");
        out.println("</head>");
        out.println("<body>");

        out.println("<h1>Baseball Database!</h1>");
        out.println("<p>Welcome to Baseball Database! This website contains the data about Major League Baseball from 2005 to 2011. It's being maintained by Nicole Bleuel and Jiabin Hu.</p>");
        out.println("<p>Please select a date you want to query.</p>");
        out.println("<form name=\"input\" action=\"games\" method=\"get\">");

        out.println("Month: <select name=\"month\">");
        for (int i = 1; i <= 12; i++)
            out.println("<option value=\"" + i + "\">" + i + "</option>");
        out.println("</select>");

        out.println("Day: <select name=\"day\">");
        for (int i = 1; i <= 31; i++)
            out.println("<option value=\"" + i + "\">" + i + "</option>");
        out.println("</select>");

        out.println("Year: <select name=\"year\">");
        for (int i = 2005; i <= 2011; i++)
            out.println("<option value=\"" + i + "\">" + i + "</option>");
        out.println("</select>");

        out.println("<input type=\"submit\" value=\"Submit\" />");
        out.println("</form> <br />");

        out.println("<form name=\"player\" action=\"playerlist\" method=\"get\">");
        out.println("Please enter a player to query: ");
        out.println("<input type=\"text\" name=\"name\" />");
        out.println("<input type=\"submit\" value=\"Submit\" />");
        out.println("</form>");

        out.println("</body>");
        out.println("</html>");

    } // end doGet method

} // end DatabaseServlet class

